package com.ny20231079080.service.impl;

import com.ny20231079080.dao.ManagerDao;
import com.ny20231079080.dao.Impl.ManagerDaoImpl;
import com.ny20231079080.entity.Managers;
import com.ny20231079080.service.ManagerService;

import java.sql.SQLException;
import java.util.List;

public class ManagerServiceImpl implements ManagerService {
    private ManagerDao  managerDao=new ManagerDaoImpl();
    @Override
    public Managers login(String name, String password) throws Exception {
        return managerDao.login(name, password);
    }

    @Override
    public List<Managers> fingAllManagers() throws SQLException, ClassNotFoundException {
        return managerDao.findAllManagers();
    }

    @Override
    public int insertManager(Managers manager) throws SQLException, ClassNotFoundException {

        return managerDao.insertManager(manager);
    }



    @Override
    public int updateManager(Managers manager) throws SQLException, ClassNotFoundException {
        return managerDao.updateManager(manager);
    }

    @Override
    public int deleteManager(int manager_id) throws SQLException, ClassNotFoundException {
        return managerDao.deleteManager(manager_id);
    }

}
